.class public Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;
.super Ljava/lang/Object;
.source "NanoHTTPD.java"

# interfaces
.implements Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$i;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "h"
.end annotation


# instance fields
.field private final a:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;

.field private final b:Ljava/io/OutputStream;

.field private c:Ljava/io/PushbackInputStream;

.field private d:I

.field private e:I

.field private f:Ljava/lang/String;

.field private g:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;

.field private h:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private i:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private j:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;

.field private k:Ljava/lang/String;

.field final synthetic l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;


# direct methods
.method public constructor <init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;Ljava/io/InputStream;Ljava/io/OutputStream;Ljava/net/InetAddress;)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->a:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;

    .line 3
    new-instance p1, Ljava/io/PushbackInputStream;

    const/16 p2, 0x2000

    invoke-direct {p1, p3, p2}, Ljava/io/PushbackInputStream;-><init>(Ljava/io/InputStream;I)V

    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->c:Ljava/io/PushbackInputStream;

    .line 4
    iput-object p4, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    .line 5
    invoke-virtual {p5}, Ljava/net/InetAddress;->isLoopbackAddress()Z

    move-result p1

    if-nez p1, :cond_1

    invoke-virtual {p5}, Ljava/net/InetAddress;->isAnyLocalAddress()Z

    move-result p1

    if-eqz p1, :cond_0

    goto :goto_0

    :cond_0
    invoke-virtual {p5}, Ljava/net/InetAddress;->getHostAddress()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object p1

    goto :goto_1

    :cond_1
    :goto_0
    const-string p1, "127.0.0.1"

    .line 6
    :goto_1
    new-instance p2, Ljava/util/HashMap;

    invoke-direct {p2}, Ljava/util/HashMap;-><init>()V

    iput-object p2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->i:Ljava/util/Map;

    const-string p3, "remote-addr"

    .line 7
    invoke-interface {p2, p3, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 8
    iget-object p2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->i:Ljava/util/Map;

    const-string p3, "http-client-ip"

    invoke-interface {p2, p3, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method private a([BI)I
    .locals 6

    const/4 v0, 0x0

    const/4 v1, 0x0

    :goto_0
    add-int/lit8 v2, v1, 0x3

    if-ge v2, p2, :cond_1

    .line 22
    aget-byte v3, p1, v1

    const/16 v4, 0xd

    if-ne v3, v4, :cond_0

    add-int/lit8 v3, v1, 0x1

    aget-byte v3, p1, v3

    const/16 v5, 0xa

    if-ne v3, v5, :cond_0

    add-int/lit8 v3, v1, 0x2

    aget-byte v3, p1, v3

    if-ne v3, v4, :cond_0

    aget-byte v2, p1, v2

    if-ne v2, v5, :cond_0

    add-int/lit8 v1, v1, 0x4

    return v1

    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    return v0
.end method

.method private a(Ljava/io/BufferedReader;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;)V
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/io/BufferedReader;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;
        }
    .end annotation

    .line 1
    :try_start_0
    invoke-virtual {p1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    new-instance v1, Ljava/util/StringTokenizer;

    invoke-direct {v1, v0}, Ljava/util/StringTokenizer;-><init>(Ljava/lang/String;)V

    .line 3
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->hasMoreTokens()Z

    move-result v0

    if-eqz v0, :cond_5

    .line 4
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->nextToken()Ljava/lang/String;

    move-result-object v0

    const-string v2, "method"

    .line 5
    invoke-interface {p2, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 6
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->hasMoreTokens()Z

    move-result v0

    if-eqz v0, :cond_4

    .line 7
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->nextToken()Ljava/lang/String;

    move-result-object v0

    const/16 v2, 0x3f

    .line 8
    invoke-virtual {v0, v2}, Ljava/lang/String;->indexOf(I)I

    move-result v2

    const/4 v3, 0x0

    if-ltz v2, :cond_1

    add-int/lit8 v4, v2, 0x1

    .line 9
    invoke-virtual {v0, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {p0, v4, p3}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->a(Ljava/lang/String;Ljava/util/Map;)V

    .line 10
    iget-object p3, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    invoke-virtual {v0, v3, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p3, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    goto :goto_0

    .line 11
    :cond_1
    iget-object p3, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    invoke-virtual {p3, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    .line 12
    :goto_0
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->hasMoreTokens()Z

    move-result v0

    if-eqz v0, :cond_3

    .line 13
    invoke-virtual {p1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v0

    :goto_1
    if-eqz v0, :cond_3

    .line 14
    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v1

    if-lez v1, :cond_3

    const/16 v1, 0x3a

    .line 15
    invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(I)I

    move-result v1

    if-ltz v1, :cond_2

    .line 16
    invoke-virtual {v0, v3, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    sget-object v4, Ljava/util/Locale;->US:Ljava/util/Locale;

    invoke-virtual {v2, v4}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;

    move-result-object v2

    add-int/lit8 v1, v1, 0x1

    invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p4, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 17
    :cond_2
    invoke-virtual {p1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

    move-result-object v0

    goto :goto_1

    :cond_3
    const-string p1, "uri"

    .line 18
    invoke-interface {p2, p1, p3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void

    .line 19
    :cond_4
    new-instance p1, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;

    sget-object p2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;->BAD_REQUEST:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    const-string p3, "BAD REQUEST: Missing URI. Usage: GET /example/file.html"

    invoke-direct {p1, p2, p3}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;)V

    throw p1

    .line 20
    :cond_5
    new-instance p1, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;

    sget-object p2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;->BAD_REQUEST:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    const-string p3, "BAD REQUEST: Syntax error. Usage: GET /example/file.html"

    invoke-direct {p1, p2, p3}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;)V

    throw p1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    move-exception p1

    .line 21
    new-instance p2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;

    sget-object p3, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;->INTERNAL_ERROR:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    new-instance p4, Ljava/lang/StringBuilder;

    invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "SERVER INTERNAL ERROR: IOException: "

    invoke-virtual {p4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p4

    invoke-direct {p2, p3, p4, p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_3

    :goto_2
    throw p2

    :goto_3
    goto :goto_2
.end method

.method private a(Ljava/lang/String;Ljava/util/Map;)V
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    const-string v0, ""

    if-nez p1, :cond_0

    .line 23
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->k:Ljava/lang/String;

    return-void

    .line 24
    :cond_0
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->k:Ljava/lang/String;

    .line 25
    new-instance v1, Ljava/util/StringTokenizer;

    const-string v2, "&"

    invoke-direct {v1, p1, v2}, Ljava/util/StringTokenizer;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 26
    :goto_0
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->hasMoreTokens()Z

    move-result p1

    if-eqz p1, :cond_2

    .line 27
    invoke-virtual {v1}, Ljava/util/StringTokenizer;->nextToken()Ljava/lang/String;

    move-result-object p1

    const/16 v2, 0x3d

    .line 28
    invoke-virtual {p1, v2}, Ljava/lang/String;->indexOf(I)I

    move-result v2

    if-ltz v2, :cond_1

    .line 29
    iget-object v3, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    const/4 v4, 0x0

    invoke-virtual {p1, v4, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v3

    iget-object v4, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    add-int/lit8 v2, v2, 0x1

    .line 30
    invoke-virtual {p1, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v4, p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    .line 31
    invoke-interface {p2, v3, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 32
    :cond_1
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    invoke-virtual {v2, p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object p1

    invoke-interface {p2, p1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    :cond_2
    return-void
.end method


# virtual methods
.method public final a()Ljava/lang/String;
    .locals 1

    .line 33
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->f:Ljava/lang/String;

    return-object v0
.end method

.method public b()V
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-string v0, "NanoHttpd Shutdown"

    const-string v1, "text/plain"

    const/16 v2, 0x2000

    :try_start_0
    new-array v3, v2, [B

    const/4 v4, 0x0

    .line 1
    iput v4, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->d:I

    .line 2
    iput v4, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I
    :try_end_0
    .catch Ljava/net/SocketException; {:try_start_0 .. :try_end_0} :catch_4
    .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_3
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 3
    :try_start_1
    iget-object v5, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->c:Ljava/io/PushbackInputStream;

    invoke-virtual {v5, v3, v4, v2}, Ljava/io/PushbackInputStream;->read([BII)I

    move-result v5
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const/4 v6, -0x1

    if-eq v5, v6, :cond_6

    :goto_0
    if-lez v5, :cond_1

    .line 4
    :try_start_2
    iget v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    add-int/2addr v0, v5

    iput v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    .line 5
    invoke-direct {p0, v3, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->a([BI)I

    move-result v0

    iput v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->d:I

    if-lez v0, :cond_0

    goto :goto_1

    .line 6
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->c:Ljava/io/PushbackInputStream;

    iget v5, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    iget v6, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    rsub-int v6, v6, 0x2000

    invoke-virtual {v0, v3, v5, v6}, Ljava/io/PushbackInputStream;->read([BII)I

    move-result v5

    goto :goto_0

    .line 7
    :cond_1
    :goto_1
    iget v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->d:I

    iget v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    if-ge v0, v2, :cond_2

    .line 8
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->c:Ljava/io/PushbackInputStream;

    iget v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->d:I

    iget v5, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    iget v6, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->d:I

    sub-int/2addr v5, v6

    invoke-virtual {v0, v3, v2, v5}, Ljava/io/PushbackInputStream;->unread([BII)V

    .line 9
    :cond_2
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->h:Ljava/util/Map;

    .line 10
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->i:Ljava/util/Map;

    if-nez v0, :cond_3

    .line 11
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->i:Ljava/util/Map;

    .line 12
    :cond_3
    new-instance v0, Ljava/io/BufferedReader;

    new-instance v2, Ljava/io/InputStreamReader;

    new-instance v5, Ljava/io/ByteArrayInputStream;

    iget v6, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->e:I

    invoke-direct {v5, v3, v4, v6}, Ljava/io/ByteArrayInputStream;-><init>([BII)V

    invoke-direct {v2, v5}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

    invoke-direct {v0, v2}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V

    .line 13
    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2}, Ljava/util/HashMap;-><init>()V

    .line 14
    iget-object v3, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->h:Ljava/util/Map;

    iget-object v4, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->i:Ljava/util/Map;

    invoke-direct {p0, v0, v2, v3, v4}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->a(Ljava/io/BufferedReader;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;)V

    const-string v0, "method"

    .line 15
    invoke-interface {v2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-static {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;->lookup(Ljava/lang/String;)Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->g:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;

    if-eqz v0, :cond_5

    const-string v0, "uri"

    .line 16
    invoke-interface {v2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->f:Ljava/lang/String;

    .line 17
    new-instance v0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;

    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    iget-object v3, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->i:Ljava/util/Map;

    invoke-direct {v0, v2, v3}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;Ljava/util/Map;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->j:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;

    .line 18
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->l:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;

    invoke-virtual {v0, p0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$i;)Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;

    move-result-object v0

    if-eqz v0, :cond_4

    .line 19
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->j:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;

    invoke-virtual {v2, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;)V

    .line 20
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->g:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;

    invoke-virtual {v0, v2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;)V

    .line 21
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v0, v2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;Ljava/io/OutputStream;)V

    goto :goto_2

    .line 22
    :cond_4
    new-instance v0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;

    sget-object v2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;->INTERNAL_ERROR:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    const-string v3, "SERVER INTERNAL ERROR: Serve() returned a null response."

    invoke-direct {v0, v2, v3}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;)V

    throw v0

    .line 23
    :cond_5
    new-instance v0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;

    sget-object v2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;->BAD_REQUEST:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    const-string v3, "BAD REQUEST: Syntax error."

    invoke-direct {v0, v2, v3}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;)V

    throw v0

    .line 24
    :cond_6
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->c:Ljava/io/PushbackInputStream;

    invoke-static {v2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/io/Closeable;)V

    .line 25
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/io/Closeable;)V

    .line 26
    new-instance v2, Ljava/net/SocketException;

    invoke-direct {v2, v0}, Ljava/net/SocketException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 27
    :catch_0
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->c:Ljava/io/PushbackInputStream;

    invoke-static {v2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/io/Closeable;)V

    .line 28
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/io/Closeable;)V

    .line 29
    new-instance v2, Ljava/net/SocketException;

    invoke-direct {v2, v0}, Ljava/net/SocketException;-><init>(Ljava/lang/String;)V

    throw v2
    :try_end_2
    .catch Ljava/net/SocketException; {:try_start_2 .. :try_end_2} :catch_4
    .catch Ljava/net/SocketTimeoutException; {:try_start_2 .. :try_end_2} :catch_3
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2
    .catch Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :catchall_0
    move-exception v0

    goto :goto_4

    :catch_1
    move-exception v0

    .line 30
    :try_start_3
    new-instance v2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;->getStatus()Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    move-result-object v3

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v2, v3, v1, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;Ljava/lang/String;)V

    .line 31
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v2, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;Ljava/io/OutputStream;)V

    .line 32
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/io/Closeable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 33
    :goto_2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->a:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;

    invoke-interface {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;->clear()V

    goto :goto_3

    :catch_2
    move-exception v0

    .line 34
    :try_start_4
    new-instance v2, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;

    sget-object v3, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;->INTERNAL_ERROR:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "SERVER INTERNAL ERROR: IOException: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v2, v3, v1, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response$Status;Ljava/lang/String;Ljava/lang/String;)V

    .line 35
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v2, v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;Ljava/io/OutputStream;)V

    .line 36
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->b:Ljava/io/OutputStream;

    invoke-static {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/io/Closeable;)V

    goto :goto_2

    :goto_3
    return-void

    :catch_3
    move-exception v0

    .line 37
    throw v0

    :catch_4
    move-exception v0

    .line 38
    throw v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 39
    :goto_4
    iget-object v1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;->a:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;

    invoke-interface {v1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;->clear()V

    .line 40
    goto :goto_6

    :goto_5
    throw v0

    :goto_6
    goto :goto_5
.end method
